.class public Lcn/cheln/explorer/ds/scan/ScanUpdateReceiver;
.super Landroid/content/BroadcastReceiver;


# instance fields
.field private a:Landroid/app/Activity;


# direct methods
.method public constructor <init>(Landroid/app/Activity;)V
    .locals 0

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    iput-object p1, p0, Lcn/cheln/explorer/ds/scan/ScanUpdateReceiver;->a:Landroid/app/Activity;

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 5

    const/4 v4, 0x1

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_SCANNER_FINISHED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "com.lewa.app.filemanager.receiveScanSignal"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    const-string v0, "receiveScanSignal--------->"

    invoke-static {v0}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;)V

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    if-eqz v0, :cond_1

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0}, Lcom/direction/hold/ui/CountActivity;->v()V

    const-string v0, "scanFinished"

    const/4 v1, 0x0

    invoke-virtual {p2, v0, v1}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v0

    if-eqz v0, :cond_1

    const-string v0, "receiveScanSignal---------> scan finished"

    invoke-static {v0}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;)V

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0, v4}, Lcom/direction/hold/ui/CountActivity;->b(Z)V

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Lcom/direction/hold/ui/CountActivity;->d(I)V

    const-string v0, "scanFinishedToast"

    invoke-virtual {p2, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcn/cheln/explorer/ds/scan/ScanUpdateReceiver;->a:Landroid/app/Activity;

    new-instance v2, Landroid/content/Intent;

    const-class v3, Lcn/cheln/explorer/ds/scan/ScanService;

    invoke-direct {v2, p1, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {v1, v2}, Landroid/app/Activity;->stopService(Landroid/content/Intent;)Z

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "toast =======================================> "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;)V

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    const-string v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_1

    sget-object v1, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    iget-object v1, v1, Lcom/direction/hold/ui/CountActivity;->a:Lcn/cheln/explorer/ds/a/d;

    iget-object v1, v1, Lcn/cheln/explorer/ds/a/d;->a:Ljava/util/Stack;

    invoke-virtual {v1}, Ljava/util/Stack;->size()I

    move-result v1

    if-le v1, v4, :cond_1

    invoke-static {p1, v0, v4}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    :cond_1
    return-void
.end method
